package com.vdm.service.impl;

import com.vdm.dao.CompanyInfoMapper;
import com.vdm.model.CompanyInfo;
import com.vdm.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompanyServiceImpl implements CompanyService {

    @Autowired
    CompanyInfoMapper companyInfoMapper;

    @Override
    public List<CompanyInfo> companyInfoList() {
        return companyInfoMapper.companyInfoInfoList();
    }

    @Override
    public int getCompanyInfoCount() {
        return companyInfoMapper.getCompanyInfoCount();
    }

    @Override
    public int updateCompanyInfoStatus(List<Integer> ids, Integer type) {
        if (ids != null && ids.size() > 0) {
            return companyInfoMapper.updateCompanyInfoStatus(ids, type);
        } else {
            return 0;
        }
    }

    @Override
    public int updateByPk(CompanyInfo companyInfo) {
        return companyInfoMapper.updateByPrimaryKeySelective(companyInfo);
    }

    @Override
    public int insertSelective(CompanyInfo companyInfo) {
        return companyInfoMapper.insertSelective(companyInfo);
    }

    @Override
    public List<CompanyInfo> getAllCompanyInfo() {
        return companyInfoMapper.getAllCompanyInfo();
    }
}